<?php
session_start();
?>

<?php
$username = $_SESSION['username'];
$role = $_SESSION['role'];
if($username==null || $username== ""|| $username == "")
{
	header('Location: http://172.26.195.159/checklist/php/logout.php');
}
?>

<html>
<head>
<title>
Feedback form
</title>

<script type="text/javascript">

function validate(feedbackform)
{
//var dada = document.getElementById('feedback');
if(feedbackform.feedback.value == "")
{
alert("Please enter your feedback");
return false;
}
return true;
}
</script>

</head>

<?php
$username = $_SESSION['username'];
$con = mysql_connect("localhost","root","");
mysql_select_db("checklist",$con);

$query = "select fullname from employees where username ='$username'";
$result = mysql_query($query);
$data = mysql_fetch_assoc($result);

$fullname = $data['fullname'];
?>

<body bgcolor="#C9C299">

<a href="welcome.php">Home</a>

<form method="POST" action="processFeedback.php" onsubmit="return validate(this);">
<table>

<tr>
<td><b>Name :</b>
<td><input type='text' name='fullname' id='fullname' value="<?php echo ''.$fullname; ?>" readonly="readonly"/></td></tr>

</br>

<tr>
<td>
<b>Suggestion/Feedback :</b>
<td><textarea id='feedback' name='feedback' cols = 18 rows = 5></textarea> </td></tr>

</br>

<tr><td><input type='submit' name='submit' value='submit' /></tr>
</center>

</form>

</body>

</html>
